<template>
  <div class="footer-box">
    <div class="content-box">
      <div class="footer-top flex">
        <span class="item">
          <img class="item-img" src="@/assets/footerA0-1.png" alt="" />
          <span>意向金可退</span>
        </span>
        <i class="item-line-60"></i>
        <span class="item">
          <img class="item-img" src="@/assets/footerA0-2.png" alt="" />
          <span>官方直销</span>
        </span>
        <i class="item-line-60"></i>
        <span class="item">
          <img class="item-img" src="@/assets/footerA0-3.png" alt="" />
          <span>价格透明</span>
        </span>
        <i class="item-line-60"></i>
        <span class="item">
          <img class="item-img" src="@/assets/footerA0-4.png" alt="" />
          <span>品牌保证</span>
        </span>
        <!-- <i class="item-line-60"></i> -->
        <span class="item select-box" >
          <el-select size="medium" v-model="urlInfo" placeholder="请选择" >
            <el-option v-for="(item,i) in linkList" 
            :key="i" 
            :label="item.link" 
            :value="item.name"
            ><span @click="hrefLink(item)">{{item.name}}</span></el-option>
          </el-select>
        </span>
      </div>
      <div class="footer-tel">
        <div class="flex">
          <img class="tel-left-img" src="@/assets/footerA0-5.png" alt="" />
          <div class="tel-right-box">
            <div class="tel-box">400-222-3333</div>
            <div class="time-box">
              客服时间：<span class="time">9:00-20:00</span>
            </div>
          </div>
        </div>
      </div>
      <div class="footer-company flex">
        <div>
          <div>
            <a v-for="item in list" :key="item.id" :label="item.name" :value="item.id" href="javascript:void(0)" style="margin:10px" @click="toList(item)">
              <i class="item-line-30"></i><span>{{item.name}}</span>
            </a>
          </div>
          <div class="company-down">
            COPYRIGHI © 2020 江铃集团 版权所有 赣ICP555555号-9
            <div class="line" style="display:none;"></div>
            E-mail:dsgs2017@163.com 技术支持：道然科技
          </div>
        </div>
        <img class="QR-code" src="@/assets/footerA0-6.png" alt="" />
      </div>
    </div>

  </div>

</template>
<script>
export default {
  data() {
    return {
      urlInfo: "相关链接",
      list: [],
      linkList:{},
    };
  },
  created() {
    this.getMenu();
    this.getLink();
},
  methods:{
    getMenu(){
          let _this = this;
          _this.$http.get('/bot_menu/find-all?shopType=2',{
      }).then(function (response) {
        _this.list = response.data;
      })
    },
    toList(item) {
      console.log(item);
      if (item.categoryDetails.length > 2) {
        this.$router.push({ path: '/menulist', query:{para:JSON.stringify(item)} })
      } else {
        if(item.type == 1){
          window.location.href = item.link
        }else{
          this.$router.push({ path: '/menulist', query:{para:JSON.stringify(item)}})
        }
        
      }
    },
    //获取相关链接
    getLink(){
      let menuId = 250;
      this.$http.get("/bot_menu/find-menuId/"+menuId).then((response) => {
        console.log("相关链接:"+response)
        this.linkList = response.data;
      });
    },
     //点击跳转
    hrefLink(list){
        console.log(list);
        window.location.href = list.link;
    }
  }
};
</script>

<style lang="scss" scoped>
.footer-box {
  padding-top: 50px;
  height: 228px;
  background: #fff;
  .content-box {
    .footer-top {
      font-size: 16px;
      .item {
        display: inline-block;
        height: 36px;
        line-height: 36px;
        .item-img {
          width: 32px;
          height: 30px;
        }
      }
      .item-line-60 {
        width: 3px;
        height: 19px;
        background: #666;
        margin: auto 60px;
      }
      .select-box {
        right: 0;
        margin-left: auto;
      }
    }
    .footer-tel {
      margin-top: 30px;
      text-align: left;
      .tel-left-img {
        width: 44px;
        height: 44px;
        margin-right: 7px;
      }
      .tel-right-box {
        .tel-box {
          // width: 158px;
          height: 24px;
          line-height: 24px;
          font-family: FZCSJW--GB1-0;
          font-size: 24px;
          font-weight: normal;
          font-style: italic;
          font-stretch: normal;
          line-height: 23px;
          letter-spacing: -1px;
          color: #e01222;
        }

        .time-box {
          height: 14px;
          line-height: 14px;
          font-family: MicrosoftYaHei;
          font-size: 14px;
          font-weight: normal;
          font-stretch: normal;
          line-height: 23px;
          letter-spacing: 0px;
          color: #696969;
        }
      }
    }
    .footer-company {
      text-align: left;
      margin-top: 32px;
      position: relative;
      .QR-code {
        position: absolute;
        right: 0;
        bottom: 0;
      }
      .company-top {
        height: 15px;
        line-height: 15px;
        .item-line-30 {
          display: inline-block;
          width: 2px;
          height: 15px;
          background: #777;
          margin: auto 30px;
        }
      }
      .company-down {
        margin-top: 20px;
      }
    }
  }
}
/*手机端*/
@media (min-width: 320px) and (max-width: 800px) {
  .footer-box {
    height: auto;
  }
  .content-box {
    width: 100%;
  }
  .footer-top {
    position: relative;
    height: 100px;
  }
  .item-line-60 {
    margin: 20px 0 !important;
    width: 1px !important;
    color: #a9a9a9 !important;
  }
  .select-box {
    position: absolute;
    top: 65px;
    left: 14px;
    right: 14px !important;
    /deep/ .el-select {
      display: block;
    }
  }
  .item {
    flex: 1;
    height: auto !important;
    line-height: 28px !important;
    .item-img {
      width: auto !important;
      height: 26px !important;
    }
    span {
      font-size: 14px;
      line-height: 28px;
      display: block;
    }
  }
  .footer-tel {
    padding-left: 14px;
  }
  .footer-company {
    padding: 140px 0 10px 14px;
    background: #fff;
  }
  .QR-code {
    top: 0;
    left: 14px;
  }
  .line {
    display: block !important;
  }
}
</style>